package com.music.server.controller;


import com.music.server.pojo.Admin;
import com.music.server.service.AdminService;
import com.music.server.utils.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 管理员 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-03-05
 */
@RestController
@RequestMapping("admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 后台管理员登录
     * @return
     */
    @PostMapping("login")
    public ResultVo login(@RequestBody Admin admin){
        Map<String, Object> map = adminService.login(admin);
        return ResultVo.ok().data("data",map);
    }
}

